<?php
namespace App\Listener;

use Hyperf\Event\Contract\ListenerInterface;
use Hyperf\Event\Annotation\Listener;

use App\Job\UserMoneyUserJob;

/**
 * @Listener 
 */
class UserMoneyUserListener implements ListenerInterface
{
    public function listen(): array
    {
        return [
            \App\Event\User\MoneyAllEvent::class,
        ];
    }
    
    // 团队业绩增加
    public function process($event)
    {
        // 执行任务
        // 复投没有团队业绩
        if(!$event->repeat)
        {
            (new UserMoneyUserJob)->push($event->user->user_all, $event->money);
        }
    }
}